package be.donovan.gui.invoice;

import be.donovan.gui.helper.components.DTOInterfacePanel;
import be.donovan.gui.helper.components.MVCPanel;
import be.donovan.model.PersonInfo;

import com.jgoodies.forms.builder.DefaultFormBuilder;
import com.jgoodies.forms.layout.FormLayout;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.LayoutManager;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTextField;

import org.jdesktop.swingx.JXDatePicker;
import org.jdesktop.swingx.JXTable;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class InvoiceLinesPanel extends MVCPanel {
	JPanel invoiceData;
	JPanel customerData;
	JPanel infoPanel;
	DTOInterfacePanel invoicePanel;

	public InvoiceLinesPanel() {
		initGUI();
	}

	private void initGUI() {
		LayoutManager thisLayout = new BorderLayout();
		this.setPreferredSize(new java.awt.Dimension(780, 400));
		this.setLayout(thisLayout);
		{
			infoPanel = new JPanel(new FlowLayout());
			{
				invoiceData = new JPanel();
				DefaultFormBuilder builder = new DefaultFormBuilder(
						new FormLayout(""));
				builder.setBorder(BorderFactory
						.createTitledBorder("Faktuur gegevens"));
				builder.appendColumn("right:pref");
				builder.appendColumn("3dlu");
				builder.appendColumn("fill:max(pref; 100px)");
				builder.appendColumn("5dlu");
				builder.appendColumn("right:pref");
				builder.append("Factuur Nr :", new JTextField(20));
				builder.nextLine();
				builder.append("Datum :", new JXDatePicker());
				builder.nextLine();
				invoiceData.add(builder.getPanel());
				// invoiceData
				// .setPreferredSize(new java.awt.Dimension(263, 73));
				infoPanel.add(invoiceData);
			}
			{
				customerData = new JPanel();
				DefaultFormBuilder builder = new DefaultFormBuilder(
						new FormLayout(""));
				builder.setBorder(BorderFactory
						.createTitledBorder("Klant gegevens"));
				builder.appendColumn("right:pref");
				builder.appendColumn("3dlu");
				builder.appendColumn("fill:max(pref; 100px)");
				builder.appendColumn("5dlu");
				builder.appendColumn("right:pref");
				builder.append("Naam :", new JTextField(20));
				builder.nextLine();
				builder.append("Adres :", new JTextField());
				builder.nextLine();
				JPanel city = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
				city.add(new JTextField(6));
				city.add(new JTextField(18));
				builder.append("", city);
				builder.nextLine();
				customerData.add(builder.getPanel());
				infoPanel.add(customerData);
			}
			this.add(infoPanel, BorderLayout.NORTH);
		}
		{
			invoicePanel = new DTOInterfacePanel();
			invoicePanel.setPreferredSize(new Dimension(780, 300));
			this.add(invoicePanel, BorderLayout.CENTER);
		}

	}

}
